#include "oqs_prov.h"
#include "test_common.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <openssl/core_dispatch.h>
#include <openssl/core_names.h>
#include <openssl/provider.h>
#include <openssl/ssl.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/trace.h>
#include <openssl/params.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/param_build.h>
#include <openssl/bio.h> 
#include <openssl/asn1.h>
#include <openssl/ec.h>
#include <openssl/rsa.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h> 


char *get_oqs_fromtls(const char *tlsname);

char *get_cls_fromtls(const char *tlsname) ;

EVP_PKEY *generate_classic_evp(const char *classic_names);

EVP_PKEY *generate_pq_evp(OSSL_LIB_CTX *libctx, const char *oqsname);

EVP_PKEY *read_pkey(const char *path);

X509_REQ *generate_cert_req(EVP_PKEY *pkey);

X509_REQ *verify_cert_req(X509 *cert,EVP_PKEY *pkey);

int get_signature_data(X509_REQ *cert_req, EVP_PKEY *pkey);

X509 *generate_final_cert(X509_REQ *cert_req,EVP_PKEY *pkey);

X509 *read_certificate(const char *path) ;

int write_privkey_to_file(const char *filename, EVP_PKEY *pkey) ;

int write_x509_to_file(const char *filename, X509 *cert) ;

int verify_sigma2(X509 *cert, EVP_PKEY *pkey);

int verify_sigma1(X509 *cert, EVP_PKEY *pkey, X509_REQ *cert_req);

int verify_hybrid_cert(OSSL_LIB_CTX *libctx,const char *signames,char * key_addr);

int create_hybrid_cert(OSSL_LIB_CTX *libctx,const char *signames,char * key_addr,char certpath[300], char classkeypath[300], char oqskeypath[300]);


